<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Student(name,id,say){
            this.name = name;
            this.id = id;
            this.say = function() {
                console.log(say);
            }
        }

        let xiaoMing = new Student('小明',1,'hello');
        let xiaoHong = new Student('小红',2,'嗨害嗨');
        let xiaoQiang = new Student('小强',3,'你好!');

        console.log(xiaoMing);
        console.log(xiaoHong);
        xiaoQiang.say();
    </script>
    <!-- <script>
        var student = new Object();
        student.name = "蔡徐坤";
        student.height = 200;
        student.weight = 300;
        student.sayHello = function() {
            console.log("hello");
        }

        console.log(student.name);
        console.log(student.weight);
        student.sayHello();
    </script> -->
    <!-- <script>
        var student = {
            name:'蔡徐坤',
            heigth: 200,
            weight: 300,
            sayHello: function() {
                console.log("hello");
            }
        }
        console.log(student.name);
        console.log(student.heigth);
        student.sayHello();
    </script> -->
    <!-- <script>
        let add = function(a,b) {
            let sum = 0;
            for (let i = 0; i < arguments.length; i++) {
                sum += arguments[i];
            }
            return sum;
        }
        console.log(add(10,20));
        console.log(add(1,2,3,4,5));
        console.log(typeof add);
    </script> -->
    <!-- <script>
        function Add(a,b,c) {
            a = a | 0;
            b = b | 0;
            c = c | 0;
            return a + b + c;
        }
        console.log(Add(1,2,3));
        console.log(Add(1,2));
    </script> -->
    <!-- <script>
        function sayHello() {
            console.log("hello");
        }
        sayHello();
    </script> -->
    <!-- <script>
        let arr = [1,2,3];
        arr.splice(0,1);
        console.log(arr);
    </script> -->
    <!-- <script>
        // 1 =>  001
        // 3 =>  011
        console.log( 1 & 3);
        console.log( 1 | 3);
        console.log( 1 ^ 3);
    </script> -->
    <!-- <script>
        let a = null;
        console.log(a);
    </script> -->
    <!-- <script>
        let a;
        console.log(a);
        console.log("hello" + a);
        console.log(1 + a);s
    </script> -->
    <!-- <script>
        console.log(1 == 1);
        // 下面的写法不科学 不建议使用
        console.log(true + 1);
        console.log(false + 1);
    </script> -->
    <!-- <script>
        let a = "hehe";
        console.log(a + "world");
        console.log(a + 10);
    </script> -->
    <!-- <script>
        let a = 'hello';
        let b = "hello";
        let c = hello; // error 这里出错
    </script> -->
    <!-- <script>
        let max = Number.MAX_VALUE;
        // 得到 Infinity
        console.log(max * 2);
        // 得到 -Infinity
        console.log(-max * 2);
        // 得到 NaN
        console.log('hehe' - 10);
    </script> -->
    <!-- <script>
        // 普通的浮点型
        let a = 1.2;
        let b = 6e3;
        // 科学计数法的表示
        let c = 7e+3;
        let d = 8E-3;
    </script> -->
    <!-- <script>
        // 十六进制 以 "0x" 或 "0X" 开头
        let a = 0xff;
        let b = 0X123;

        // 八进制 以 "0" 开头
        let c = 07;
        
        // 二进制 以 "0b" 或 "0B" 开头
        let d = 0b1010;
        let e = 0B1111; 
    </script> -->
    <!-- <script>
        console.log("这是打印日志的");
    </script> -->
    <!-- <script>
        // 单行注释
        /*
            多行注释
            多行注释
        */
    </script>
    <script src='1.js'></script> -->
    <!-- <script>
        alert("hello world");
    </script> -->
    <!-- <input type="button" value="点我一下" onclick="alert('你还真点')"> -->
    <!-- <script>
        alert("hello");
    </script> -->
</body>
</html>